Data transmission apparatus, system and method, and image processing apparatus

ABSTRACT

A data transmission system where an image providing device and a printer are directly connected by a 1394 serial bus, a command is sent from the image providing device to the printer, then a response to the command is returned from the printer to the image providing device. Image data is sent from the image providing device to the printer based on information included in the response. The printer converts the image data outputted from the image providing device into print data. Thus, printing can be performed without a host computer by directly connecting the image providing device and the printer by the 1394 serial bus or the like.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a data transmission apparatus, systemand method and an image processing apparatus, and more particularly, toa data transmission apparatus, system and method and an image processingapparatus used in a case where an image providing device such as adigital camera is directly connected to an image processing device suchas a printer via a serial interface based on, e.g., the IEEE 1394standards.

2. Description of Related Art

Various types of systems which transfer data to a printer via a bus areknown. For example, a known technique is to output data from a computerto the printer by using a defacto standard interface such as a SCSI(Small Computer System Interface) or Centronics interface.

In other words, the printer is connected to a personal computer (PC)used as a host device via a parallel or serial interface such as acentronics or RS232C interface.

Further, digital devices as image providing devices such as a scanner, adigital still camera and a digital video camera, are also connected tothe PC. Image data inputted by the respective digital devices istemporarily stored in a hard disk or the like on the PC, then processedby an application software program or the like on the PC and convertedinto print data for the printer, and transferred via the above interfaceto the printer.

In the above system, the PC has driver software programs, respectively,for controlling the digital devices and the printer. The image dataoutputted from the digital devices is held by these driver softwareprograms in data format which can be easily handled and displayed on thePC. The stored data is converted into the print data by an imageprocessing method in consideration of image characteristics of the inputand output devices.

Today it is possible for a new interface such as an interface based onthe IEEE 1394 standards (hereinafter referred to as “1394 serial bus”)to directly connect an image providing device and a printer. In case ofdirectly connecting the image providing device to the printer by the1394 serial bus, an FCP (Function Control Protocol) operand may includeprint data. Further, in the 1394 serial bus, a register area for may beprovided such that data transfer is performed by writing data into theregister area.

Further, as the 1394 serial bus has a plurality of data-transfer controlprocedures, data transfer can be performed in methods appropriate to therespective devices.

Further, the 1394 serial bus has an isochronous transfer mode and anasynchronous transfer mode. Time-restricted data, e.g., real-time data,is transferred by isochronous transfer, while simple data transfer isperformed by asynchronous transfer.

As described above, the image data outputted from the image providingdevice is converted into print data by the PC and print-outputted by theprinter, accordingly, even if the image providing device and the printerare directly connected, printing cannot be performed without the PC. Avideo printer which directly print-outputs image data outputted from adigital video camera is known, however, even in case of using thisprinter, connection is made only between specific devices. There is novideo printer which is directly connected to a number of image providingdevices for general printing purposes. That is, it is impossible todirectly send image data from the image providing device to a printerfor printing, by utilizing a function to directly connect devices, whichis characteristic of the 1394 serial bus or the like.

In the above method which directly connects the image providing deviceto the printer with the 1394 serial bus and includes print data into anFCP operand, the control commands cannot be separated from the printdata. Further, in this method, the transfer efficiency is low since aresponse is always required with respect to a command. The above methodproviding a register area for data transfer requires processing todetermine whether or not data can be written into the register area atevery data transfer. Accordingly, the overhead of the determinationprocessing is great, which degrades the transfer efficiency.

Further, to ensure connection with various types of devices, a pluralityof data transfer methods appropriate to the respective devices arerequired.

The data transfer methods are briefly classified into a PUSH method inwhich a host device writes data into a target device and a PULL methodin which a target device reads data from a host device. One of thesetransfer methods is determined in accordance with resources of both hostand target devices. However, in case of directly connecting with varioustypes of devices, it is impossible to determine which method, the PUSHmethod or the PULL method, as the data transfer method.

Further, as the basic transfer method of in the synchronous mode isdifferent from the asynchronous mode, it is difficult to change thesynchronous and asynchronous modes in the same transfer procedure.

SUMMARY OF THE INVENTION

The present invention has been made to solve the respective or all ofthe above problems, and has its object to provide a data transmissionapparatus, system and method and an image processing apparatus,appropriate for directly connecting a host device with a target deviceby using a serial interface based on the 1394 serial bus or the like andprocessing image data, directly sent from the host device to the targetdevice, by the target device.

Further, another object of the present invention is to provide a datatransmission apparatus, system and method and an image processingapparatus which separate control commands from data and attain hightransfer efficiency.

Further, another object of the present invention is to provide a datatransmission apparatus, system and method and image processing apparatuswhich set a data transfer method appropriate to a connected device.

Further, another object of the present invention is to provide a datatransmission apparatus, system and method and image processing apparatuswhich perform data transfer by a PULL method.

According to the present invention, the foregoing objects are attainedby providing a data transmission method for host and target deviceswhich are connected by a serial bus, the method comprising the steps of:performing bi-directional communication between the host and targetdevices; and setting a data transfer method to be performed from aplurality of data transfer methods including a PULL model in which thetarget device reads data from the host device, based on thebi-directional communication.

Further, the foregoing objects are attained by providing an imageprocessing apparatus comprising: communication means for performingcommunication with a target device by the data transfer method in theabove data transmission method; and transmission means for transmittingimage data to the target device via the communication means.

Further, the foregoing objects are attained by providing a datatransmission system for transferring data through a serial bus,comprising: communication means for performing bi-directionalcommunication between host and target devices; and setting means forsetting a data transfer method to be set from a plurality of datatransfer methods including a PULL model, based on the bi-directionalcommunication.

Further, another object of the present invention is to provide a datatransmission apparatus, system and method and an image processingapparatus which perform synchronous transfer and asynchronous transferin the same transfer procedure.

According to the present invention, the foregoing object is attained byproviding a data transmission method of host and target devices whichare connected by a serial bus, the method comprising the steps of:transferring data from the host device to the target device, byisochronous transfer or asynchronous transfer; and transferring aprocedure signal for transfer of the data to the host and target devicesby common asynchronous transfer.

Further, the foregoing object is attained by providing a datatransmission apparatus connected to a serial bus, comprising: transfermeans for transferring a procedure signal for data transfer byasynchronous transfer common to a target device; and transmission meansfor transmitting data to be transmitted to the target device byisochronous transmission or asynchronous transmission.

Further, the foregoing object is attained by providing a datatransmission system for transferring data through a serial bus,comprising: first transfer means for transferring a procedure signal fordata transfer by common asynchronous transfer to host and targetdevices; and second transfer means for performing data transfer betweenthe host and target devices by isochronous transfer or the asynchronoustransfer.

Other features and advantages of the present invention will be apparentfrom the following description taken in conjunction with theaccompanying drawings, in which like reference characters designate thesame name or similar parts throughout the figures thereof.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of the specification, illustrate embodiments of the invention and,together with the description, serve to explain the principles of theinvention.

FIG. 1A is an explanatory view showing a general construction of asystem to which the present invention is applied;

FIG. 1B is a block diagram showing an example of a network systemconstructed with an IEEE 1394 serial interface;

FIG. 2 is a block diagram showing the construction of the IEEE 1394serial interface;

FIG. 3 is an explanatory view showing address space of the IEEE 1394serial interface;

FIG. 4 is a cross-sectional view showing a cable for the IEEE 1394serial interface;

FIG. 5 is a timing chart explaining a Data/Strobe Link method;

FIGS. 6 to 8 are flowcharts showing a procedure of network constructionin the IEEE 1394 serial interface;

FIG. 9 is a block diagram showing an example of the network;

FIGS. 10A and 10B are block diagrams explaining bus arbitration;

FIG. 11 is a flowchart showing a procedure of the bus arbitration;

FIG. 12 is a timing chart showing transitional statuses in asynchronousdata transfer;

FIG. 13 is a diagram showing a packet format for the asynchronoustransfer;

FIG. 14 is a timing chart showing transitional statuses in isochronousdata transfer;

FIG. 15A is an example of a packet format for the isochronous transfer;

FIG. 15B is a table showing the details of packet format fields for theisochronous transfer in a 1394 serial bus;

FIG. 16 is a timing chart showing transitional statuses in data transferon the bus when the isochronous transfer and asynchronous transfer aremixedly performed;

FIG. 17 is a schematic view showing the IEEE 1394 serial interface incomparison with an OSI model;

FIG. 18 is an explanatory view showing the basic operation of a LOGINprotocol;

FIG. 19 is an explanatory view showing connection status in the IEEE1394 serial interface;

FIG. 20 is a timing chart showing the flow of log-in operation;

FIG. 21 is a schematic view showing a CSR preparing respective devices;

FIG. 22 is a flowchart showing LOGIN processing in a host device;

FIG. 23 is a flowchart showing LOGIN processing in a target device;

FIG. 24 is an explanatory view showing a case in consideration of adevice without the LOGIN protocol;

FIG. 25 is a schematic view showing the IEEE 1394 serial interface incomparison with an OSI model, in the second embodiment;

FIG. 26A is a table showing functions of a CSR architecture of the 1394serial bus;

FIG. 26B is a table showing registers for the 1394 serial bus;

FIG. 26C is a table showing registers for node resources of the 1394serial bus;

FIG. 26D is an example of a minimum format of a configuration ROM of the1394 serial bus;

FIG. 26E is an example of a general format of the configuration ROM ofthe 1394 serial bus;

FIG. 27A is a timing chart showing a request-response protocol withread, write and lock commands, based on the CSR architecture in atransaction layer;

FIG. 27B is a timing chart showing services in a link layer;

FIG. 28A is a timing chart showing an operation example of a splittransaction;

FIG. 28B is an explanatory view showing transitional statuses oftransfer by the split transaction;

FIG. 29 is an explanatory view showing an AV/C transaction in the 1394serial bus;

FIG. 30 is an example of the packet format for the asynchronous transferincluding an FCP packet frame;

FIG. 31 is an example of the structure of an AV/C command frame;

FIG. 32 is an example of the structure of an AV/C response frame;

FIG. 33 is a schematic view showing a register map;

FIG. 34 is an explanatory view showing the flow of frames from an imageproviding device to the printer;

FIG. 35 is an explanatory view showing the construction of a formatregister;

FIG. 36 is an explanatory view showing the detailed construction of astatus register of a common register group;

FIG. 37 is an explanatory view showing the details of information heldin a register GLOBAL of a common register group;

FIG. 38 is an explanatory view showing the details of information heldin a register LOCAL of the common register group;

FIG. 39 is an explanatory view showing the details of information heldin a register format[1];

FIG. 40 is an explanatory view showing the details of information heldin a register format[2];

FIG. 41 is a table showing commands and responses to the commands;

FIG. 42 is an example of an image data formats supported by the DPPprotocol;

FIG. 43 is a timing chart showing the flow of format setting processing;

FIG. 44 is a timing chart showing the flow of data-transfer methodsetting processing;

FIG. 45 is an explanatory view showing a register map of registersnecessary for transfer method 1 and transfer method 2, in address spaceof the 1394 serial bus;

FIG. 46 is an example of a data packet frame;

FIG. 47 is an example of the structure of a data header;

FIG. 48 is an explanatory view showing data packet frame processing inthe printer in block transfer;

FIG. 49 is a timing chart showing commands and responses FreeBlock inthe transfer method 1;

FIG. 50 is a timing chart showing the flow of data transfer in thetransfer method 1;

FIG. 51 is a timing chart showing the flow of data transfer in thetransfer method 2;

FIG. 52 is a timing chart showing the commands and responses FreeBlockin the transfer method 1, in detail;

FIG. 53 is a timing chart showing a commands and responses WriteBlock inthe transfer method 1 and the transfer method 2;

FIG. 54 is a timing chart showing the commands and responses WriteBlockin the transfer method 1 and the transfer method 2, in detail;

FIG. 55 is a timing chart showing the flow of WriteBlock errorprocessing upon occurrence of bus reset;

FIG. 56 is an explanatory view showing the construction of commandregisters, response registers and data registers of the image providingdevice and the printer, in a PUSH Large Buffer Model;

FIG. 57 is a timing chart showing the flow of operation in a PUSH buffermodel between the image providing device and the printer;

FIG. 58 is an example of a data packet in a data frame;

FIG. 59 is an explanatory view of the relation between the data registerand the buffer of the printer;

FIG. 60 is an explanatory view showing the construction of the commandregisters, the response registers and the data registers of the imageproviding device and the printer, in a PULL buffer model;

FIG. 61 is a timing chart showing the flow of operation in the PULLbuffer model between the image providing device and the printer;

FIG. 62 is an explanatory view showing the relation between the dataregister and the buffer of the image providing device;

FIG. 63 is an explanatory view showing memory allocation for commandregisters and response registers for flow control; and

FIG. 64 is a timing chart showing the flow of print processing.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

Hereinbelow, a data transfer method according to an embodiment of thepresent invention will now be described in detail in accordance with theaccompanying drawings.

FIG. 1A shows an example of general construction of a system to whichthe present invention is applied, where a PC 103, a printer 102 and adigital video camera (DVC) 101 are connected via a 1394 serial bus. Thenthe outline of the 1394 serial bus will be described below.

[Outline of 1394 Serial Bus]

With the appearance of general digital video cam recorder (VCR) anddigital video disk (DVD) player, there is a need for transferringrealtime and large amount data such as video data and audio data(hereinafter referred to as “AV data”). To transfer AV data in realtimeto a personal computer (PC) or other digital devices, an interfacecapable of high-speed data transfer is required. The 1394 serial bus hasbeen developed from the above point.

FIG. 1B shows an example of a network system constructed with a 1394serial bus. This system comprises devices A to H, and the devices A andB, the devices A and C, the devices B and D, the devices D and E, thedevices C and F, the devices C and G, and the device C and H arerespectively connected by a twisted pair cable for the 1394 serial bus.These devices A to H may be computers such as a personal computer, ormost computer-peripheral devices such as a digital VCR, a DVD player, adigital still camera, a storage device using a storage medium such as ahard disk or an optical disk, a monitor such as a CRT or an LDC, atuner, an image scanner, a film scanner, a printer, a MODEM, and aterminal adapter (TA).

Note that the printing method of the printer may be any method, e.g., alaser-beam printing, an electrophotographic method using an LED, anink-jet method, a thermal-transfer method of ink melting or inksublimation type and a thermo-sensitive printing method.

The connection between the devices may be made by mixedly using a daisychain method and a node branching method, thus realizing high-freedom ofconnecting.

The respective devices have an ID, and they construct a network byidentifying each ID within a range connected by the 1394 serial bus. Forexample, the devices respectively take a relaying role only bydaisy-chain connecting the devices with cables for the 1394 serial bus,thus constructing a network.

As the 1394 serial bus corresponds to Plug and Play function, itautomatically recognizes a device connected to the cable, thusrecognizes connection status. In the system as shown in FIG. 1B, when adevice is removed from the network, or a new device is added to thenetwork, the bus is automatically reset (i.e., the current networkconstructing information is reset), and a new network is constructed.This function enables realtime setting and recognition of networkconstruction.

The 1394 serial bus has a data transfer speed defined as 100/200/400Mbps. A device having a high transfer speed supports a lower transferspeed, thus maintaining compatibility. As data transfer modes, anasynchronous transfer mode (ATM) for transferring asynchronous data suchas a control signal, an isochronous transfer mode for transferringisochronous data such as realtime AV data are available. In datatransfer, within each cycle (generally 125 μs/cycle), a cycle startpacket (CSP) indicating the start of cycle is transferred, and thenasynchronous and isochronous data are mixedly transferred such that theisochronous data transfer is transferred prior to the asynchronous data.

FIG. 2 shows the construction of the 1394 serial bus, as a layerstructure. As shown in FIG. 2, a connector port 810 is connected to aconnector at the end of a cable 813 for the 1394 serial bus. A physicallayer 811 and a link layer 812 in a hardware unit 800 are positioned asupper layers with respect to the connector port 810. The hardware unit800 comprises interface chips. The physical layer 811 performs coding,connection-related control and the like, and the link layer 812, packettransfer, cycle-time control and the like.

In a firmware unit 801, a transaction layer 814 manages data to betransferred (transaction data), and outputs commands Read, Write andLock. A management layer 815 in the firmware unit 801 manages connectionstatuses and ID's of the respective devices connected to the 1394 serialbus, thus manages the network construction. The above hardware andfirmware units substantially constructs the 1394 serial bus.

In a software unit 802, an application layer 816 differs in softwareused by the system, and the data transfer protocol indicating how totransfer data on the interface is defined by a protocol such as aprinter protocol or an AVC protocol.

FIG. 3 shows address space of the 1394 serial bus. All the devices(nodes) connected to the 1394 serial bus have a unique 64 bit address.The 64 bit address is stored in a memory of the devices. Datacommunication with a designated destination device can be performed byalways recognizing the node addresses of the transmitting- andreceiving-side nodes.

Addressing of the 1394 serial bus is made based on the IEEE 1212standards, such that first 10 bits are allocated for designating a busnumber, then next 6 bits are allocated for designating an node ID.

48-bit address used in the respective devices are divided into 20 bitsand 28 bits, and utilized in the unit of 256 Mbytes. In the initial20-bit address space, “0” to “0xFFFFD” is called a memory space;“0xFFFFE”, a private space; “0xFFFFF”, a register space. The privatespace is an address freely used in the device. The register space,holding information common to the devices connected with the bus, isused for communication among the respective devices.

In the register space, the initial 512 bytes are assigned to a registercore (CSR core) as a core of a Command/Status Register (CSR)architecture; the next 512 bytes, to a register of the serial bus; thenext 1024 bytes, to a configuration ROM; and the remaining bytes, to aregister unique to the device in a unit space.

Generally, for the sake of simplification of bus system design fordifferent node types, it is preferable that only the initial 2048 bytesare used for the nodes, and as a result, total 4096 bytes are usedincluding the initial 2048 bytes for the CSR core, the register of theserial bus, the configuration ROM and the unit space.

The 1394 serial bus has the construction as described above. Next, thefeatures of the 1394 serial bus will be described in more detail.

[Electrical Specification of 1394 Serial Bus]

FIG. 4 shows a cross-section of the cable of the 1394 serial bus. The1394 serial cable comprises two sets of twisted pair signal lines andtwo power-source lines. This construction enables power supply to adevice which lacks a power source, or a device where a voltage isdegraded due to a failure or the like. The direct-current voltagesupplied by the power-source lines is 8 to 40V; the current is maximum1.5 A. Note that in the standards for so-called DV cable, four linesexcept the power-source line construct the cable.

[DS-Link]

FIG. 5 is a timing chart explaining a DS-Link (Data/Strobe-Link) methodas a data transfer method.

The DS-Link method, appropriate for high-speed serial datacommunication, requires two sets of two signal lines. That is, one ofthe two sets of twisted-pair signal lines is used for sending a datasignal, and the other one set of twisted-pair signal lines is used forsending a strobe signal. On the receiving side, an EXCLUSIVE-OR betweenthe data signal and the strobe signal is obtained so as to generate aclock signal. In the DS-Link transfer, it is unnecessary to mix a clocksignal into a data signal, therefore, transfer efficiency is higher thanthat in other serial-data transfer methods. Further, as a clock signalis generated from the data signal and the strobe signal, a phase lockedloop (PLL) circuit can be omitted, which attains downsizing of the scaleof a controller LSI. Further, in the DS-Link transfer, it is unnecessaryto send information indicative of idle status when there is no data tobe transferred, therefore, a transceiver of each device can be set in asleep status, which reduces electric consumption.

[Bus-Reset Sequence]

The respective devices (nodes) connected to the 1394 serial bus areprovided with a node ID, and are recognized as nodes constructing thenetwork. For example, when increase/decrease of the number of nodes dueto connection/disconnection or power ON/OFF status of network devices,i.e., network construction changes and it is necessary to recognize anew network construction, the respective nodes detect the change ofnetwork construction, send a bus-reset signal onto the bus, and enter amode for recognizing the new network construction. The detection ofchange of network construction is made by detecting change of biasvoltage at the connector port 810.

When the bus-reset signal is sent from one node, the physical layer 811of the respective nodes receives the bus-reset signal, and at the sametime, notifies the link layer 812 of the occurrence of bus reset, andforwards the bus-reset signal to the other nodes. When all the nodeshave received the bus-reset signal, a bus-reset sequence is started.Note that the bus-reset sequence is started when the cable isattached/detached, or the hardware unit 800 has detected networkabnormity or the like. Further, the bus-reset sequence is also startedby a direct instruction to the physical layer 811 such as host controlby a protocol. As the bus-reset sequence is started, data transfer issuspended during the bus reset, and after the bus reset, the datatransfer is restarted in the new network construction.

[Node-ID Determination Sequence]

After the bus reset, the respective nodes start to obtain a node ID soas to construct a new network construction. A general sequence from thebus reset to node-ID determination will be described with reference tothe flowcharts of FIGS. 6 to 8.

FIG. 6 is a flowchart showing a sequence from occurrence of bus-resetsignal to node-ID determination and data transfer. At step S101, therespective nodes always monitor occurrence of bus-reset signal. When thebus-reset signal has occurred, the process proceeds to step S102, atwhich to obtain a new network construction in a state where the networkconstruction has been reset, parent-child relation is declared betweennodes connected to each other. Step S102 is repeated until it isdetermined at step S103 that the parent-child relation has beendetermined among all the nodes.

As the parent-child relation has been determined, the process proceedsto step S104, at which one “root (node)” is determined. At step S105,node-ID setting is performed so as to provide an ID to the respectivenodes. The node-ID setting is made in a predetermined order of thenodes. Step S105 is repeated until it is determined at step S106 thatthe ID's have been given to all the nodes.

As the node-ID setting has been completed, since the new networkconstruction has been recognized by all the nodes, data transfer amongthe nodes is possible. At step S107, data transfer is started, and theprocess returns to step S101, at which occurrence of bus-reset signal ismonitored again.

FIG. 7 is a flowchart showing the sequence from the monitoring ofbus-reset signal (S101) to the root determination (S104) in detail. FIG.8 is a flowchart showing the node-ID setting (S105 and S106) in detail.

In FIG. 7, at step S201, the occurrence of bus-reset signal ismonitored, and as the bus-reset signal has occurred, the networkconstruction is reset. Next, at step S202, as a first step forre-recognizing the reset network construction, the respective devicesreset its flag FL with data indicative of “leaf (node)”. At step S203,the respective devices examine the number of ports, i.e., the number ofother nodes connected to them. At step S204, based on the result ofexamination at step S203, the devices examine the number of undefined(i.e., parent-child relation has not been determined) ports. The numberof undefined ports is equal to that of the ports immediately after thebus reset, however, with the progress of determination of parent-childrelation, the number of undefined ports detected at step S204 decreases.

Only actual leaf(ves) can declare parent-child relation immediatelyafter the bus reset. Whether or not the node is a leaf is detected fromthe number of ports examined at step S203; i.e., if the number of portsis “1”, the node is a leaf. The leaf declares that “this node is achild, and the connected node is a parent” at step S205, then terminatesthe operation.

On the other hand, a node that detected at step S203 that the number ofports is “two or more” is a “branch”. Immediately after the bus reset,as “undefined ports>1” holds, the process proceeds to step S206, atwhich the flag FL is set with data indicative of “branch”, thendeclaration of parent-child relation from another node is waited at stepS207. When the parent-child relation is declared from another node, theprocess returns to step S204 at which the branch examines the number ofundefined ports. If the number of undefined ports is “1”, the branch candeclare at step S205 that “this node is a child, and the connected nodeis a parent” to the node connected to the remaining port. If the numberof undefined ports is still “two or more”, the branch waits fordeclaration of parent-child relation from another node at step S207.

When any one of the branches (or exceptionally leaf(ves) which delayeddeclaring a child) detects that the number of undefined ports is “0”,the parent-child declaration of the overall network has been completed.The only one node that has “0” undefined port, i.e., the parent of allthe nodes, sets the flag FL with data indicative of a “root” at stepS208. Then at step S209, the node is recognized as a root.

In this manner, the procedure from the bus reset to the parent-childdeclaration among all the nodes in the network ends.

Next, a procedure of providing each node with an ID will be described.First, the ID setting is performed at the leaves. Then, ID's are set innumerical order (from node number: 0) from leaves→branches→root.

In FIG. 8, at step S301, the process splits in accordance with nodetype, i.e., leaf, branch or root, based on the data set at the flags FL.

In case of leaf, at step S302, the number of leaves (natural number) inthe network is set to a variable N. At step S303, the respective leavesrequest a node number to the root. If a plurality of requests have beenmade, the root performs arbitration at step S304, and provides a nodenumber to one node at step S305, while notifies the other nodes of theresult of acquisition of node-number indicating that the node number hasbeen failed.

A leaf that has not obtained a node number (NO at step S306) repeats therequest for node number at step S303. On the other hand, a leaf that hasobtained a node number notifies all the nodes of the obtained nodenumber by broadcasting ID information including the node number. As thebroadcasting of the ID information has been completed, the variable Nindicative of the number of leaves is decremented at step S308. Then,from the determination at step S309, the procedure from step S303 tostep S308 is repeated until the variable N becomes “0” in thedetermination at step S309. When ID information on all the leaves havebeen broadcasted, the process proceeds to step S310, for setting ID's ofbranches.

The ID setting for branches is performed substantially similar to the IDsetting for the leaves. First, at step S310, the number of branches(natural number) is set to a variable M. At step S311, the respectivebranches request the root for a node number. In response to therequests, the root performs arbitration at step S312, and provides anode number, subsequent to the last leaf node number, to a branch atstep S313, while notifies the other branches of the result ofacquisition of node-number indicating that the node number has beenfailed.

A branch that has not obtained a node number (NO at step S314) repeatsthe request for node number at step S315. On the other hand, a branchthat has obtained a node number notifies all the nodes of the obtainednode number by broadcasting ID information including the node number. Asthe broadcasting of the ID information has been completed, the variableM indicative of the number of branches is decremented at step S316.Then, from the determination at step S317, the procedure from step S311to step S316 is repeated until the variable M becomes “0” in thedetermination at step S317. When ID information on all the leaves havebeen broadcasted, the process proceeds to step S318, for setting the IDof the root.

At this time, it is only the root that has not obtained a node ID. Atstep S318, the root obtains the smallest number that has not beenprovided to any other node as the node ID of the root, and at step S319,broadcasts ID information on the root.

As described above, the procedure until the node ID's for all the nodeshave been set ends. Next, the sequence of node ID determination will bedescribed with reference to the network example shown in FIG. 9.

In the network in FIG. 9, a node B as a root is directly connected toits lower nodes A and C; the node C is directly connected to its lowernode D; and the node D is directly connected to its lower nodes E and F.The procedure of determining this hierarchical structure, the root nodeand the node ID's will be described below.

After the bus reset has occurred, to recognize connection statuses ofthe respective nodes, parent-child relation is declared between ports ofdirectly connected nodes. “parent” means a node at an upper level and“child” means a node at a lower level in the hierarchical structure. InFIG. 9, the node that first declared parent-child relation after the busreset is the node A. As described above, nodes (leaves) where only oneport is connected can start declaration of parent-child relation. Thatis, if the number of ports is “1”, it is recognized that the node is theend of the network tree, i.e., a leaf. The declaration of parent-childrelation is started from the leaf which has first taken action amongthese leaves. Thus, a port of the leave node is set as a “child”, whilethe port of another node connected to the leave node is set as a“parent”. In this manner, “child-parent” relation is sequentially setbetween the nodes A and B, between the nodes E and D, and between thenodes F and D.

Further, among upper nodes having a plurality of ports, i.e., branches,parent-child relation is sequentially declared with respect to uppernode(s), from the node that first received declaration of parent-childrelation from the leaf. In FIG. 9, first parent-child relation isdetermined between the nodes D and E and between the nodes D and F. Thenthe node D declares parent-child relation with respect to the node C,and as a result, a relation “child-parent” is set between the nodes Dand C. The node C, that has received the declaration of parent-childrelation from the node D, declares parent-child relation with respect tothe node B connected to the other port, thus “child-parent” relation isset between the nodes C and B.

In this manner, the hierarchical structure as shown in FIG. 9 isconstructed. The node B, that has finally become the parent at all theports, is determined as a root. Note that a network has only one root.In a case where the node B that has received declaration of parent-childrelation from the node A immediately declares parent-child relation withrespect to another node, the other node, e.g., the node C, may be theroot node. That is, any node may be a root depending upon timing oftransmitting declaration of parent-child relation, and further, even ina network maintaining the same construction, a particular node is notalways become a root.

As the root has been determined, the sequence of determining therespective node ID's is started. Each node has a broadcast function tonotify its ID information to all the other nodes. ID informationincludes a node number, information on a connected position, the numberof ports, the number of ports connected to other nodes, information onparent-child relation on the respective ports and the like.

As described above, the assignment of node numbers is started from theleaves. In numerical order, node number =0, 1, 2, . . . is assigned.Then, by the broadcasting of ID information, it is recognized that thenode number has been assigned.

As all the leaves have obtained a node number, node numbers are assignedto the branches. Similar to the assignment of node numbers to theleaves, ID information is broadcasted from the branch that received anode number, and finally, the root broadcasts its ID information.Accordingly, the root always has the greatest node number.

Thus, as the ID setting of the overall hierarchical structure has beencompleted and the network has been constructed, then the businitialization is completed.

[Control Information for Node Management]

The CSR core as shown in FIG. 3 exists on the register as a basicfunction of the CSR architecture for node management. FIG. 26A shows thepositions and functions of the registers. In FIG. 26A, the offset is arelative position from “0 xFFFFF0000000.

In the CSR architecture, the register for the serial bus is arrangedfrom “0xFFFFF0000200”. FIG. 26B shows the positions and functions of theregisters.

Further, information on node resources of the serial bus is arrangedfrom “0xFFFFF0000800”. FIG. 26C shows the positions and functions of theregisters.

The CSR architecture has a configuration ROM for representing functionsof the respective nodes. The configuration ROM has a minimum format anda general format, arranged from “0xFFFFF0000400”. As shown in FIG. 26D,the minimum format configuration ROM merely shows a vendor ID which is aunique numerical value represented by 24 bits.

As shown in FIG. 26E, the general format configuration ROM hasinformation on a node. In this case, the vendor ID in this format isincluded in a “root_directory”. Further, “bus_info_block” and“root&unit_leaves” include unique device number including the vendor ID,represented by 64 bits. The device number is used after networkreconstruction by bus reset operation, to continue recognition of thenode.

[Serial Bus Management]

As shown in FIG. 2, the protocol of the 1394 serial bus comprises aphysical layer 811, a link layer 812 and a transaction layer 814. Thisprovides, as the serial bus management, a basic function for nodemanagement and bus resource management, based on the CSR architecture.

Only one node which performs bus management (hereinafter referred to as“bus management node”) exists on the same bus, and provides the othernodes on the serial bus with management function which includes cyclemaster control, performance optimization, power source management,transmission speed management, construction management and the like.

The bus management function briefly divides into a bus manager, anisochronous resource manager and a node control function. The nodecontrol is a management function which enables communication among thenodes in the physical layer 811, the link layer 812, the link layer 812,the transaction layer 814 and an application program by the CSR. Theisochronous resource manager, which is a management function necessaryfor isochronous-type data transfer on the serial bus, manages assignmentof transfer bandwidth and channel number to isochronous data. For thismanagement, after bus initialization, the bus management node isdynamically selected from nodes having the isochronous resource managerfunction.

Further, in a construction without a bus management node on the bus, anode having the isochronous resource manager function performs a part ofthe bus management such as the power source management and cycle mastercontrol. Further, the bus management is a management function as serviceto provide a bus control interface to an application program. Thecontrol interface uses a serial-bus control request(SB_CONTROL.request), a serial-bus event control confirmation(SB_CONTROL.confirmation) and a serial-bus event indication(SB_EVENT.indication).

The serial-bus control request is used when an application programrequires the bus management node to perform bus reset, businitialization, representation of bus-status information, and the like.The serial-bus event control confirmation is the result of theserial-bus control request, and is notified from the bus management nodeto the application for confirmation. The serial-bus event controlconfirmation is made as notification of an asynchronously-caused eventfrom the bus management node to the application.

[Data Transfer Protocol]

The data transfer by using the 1394 serial bus simultaneously sendsisochronous data (isochronous packet) which must be periodicallytransmitted, and asynchronous data (asynchronous packet) which can betransmitted/received at arbitrary timing, further, ensures real-timetransmission of isochronous data. In the data transfer, a bus use rightis requested prior to transfer, and bus arbitration is performed toobtain bus use permission.

In the asynchronous transfer, a transmitting node ID and a receivingnode ID are sent with transfer data as packet data. The receiving nodeconfirms the receiving node ID, i.e., its node ID, receives the packet,and returns an acknowledge signal to the transmitting node. Thus, onetransaction is completed.

In the isochronous transfer, a transmitting node requires an isochronouschannel with a transmission speed, and a channel ID is sent withtransfer data as packet data. A receiving node confirms a desiredchannel ID and receives the data packet. The necessary channel numberand transmission speed are determined by the application layer 816.

These transfer protocols are defined by the physical layer 811, the linklayer 812 and the transaction layer 813. The physical layer 811 performsphysical and electrical interface with the bus, automatic recognition ofnode connection, bus arbitration for a bus use right among nodes, andthe like. The link layer 812 performs addressing, data checking, packettransmission/reception and cycle control for isochronous transfer. Thetransaction layer 814 performs processing relating to asynchronous data.Hereinbelow, the processings in the respective layers will be described.

[Physical Layer]

The bus arbitration in the physical layer 811 will be described.

The 1394 serial bus always performs arbitration of bus use right priorto data transfer. The devices connected to the 1394 serial busrespectively relay a signal transferred on the network, thusconstructing a logical bus-type network transmitting the signal to allthe devices within the network. This necessitates bus arbitration toavoid packet conflict. As a result of bus arbitration, one node cantransfer data during a certain period.

FIGS. 10A and 10B are block diagrams explaining the bus arbitration.FIG. 10A shows operation to request a bus use right; and FIG. 10B,operation to allow to use the bus.

When the bus arbitration is started, a single or plurality of nodesrespectively request a bus use right to use the bus to its parent node.In FIG. 10A, the nodes C and F request a bus use right. The parent node(node A in FIG. 10A) that has received the request relays the request byfurther requesting a bus use right to its parent node. The request isforwarded to a root (node B in FIG. 10A) that finally performsarbitration.

The root that has received the request for bus use right determines anode to be provided with the bus use right. This arbitration can beperformed only by the root. The node that dominated in the arbitrationis provided with the bus use right. FIG. 10B shows that the node C hasobtained the bus use right and the request from the node F has beenrejected.

The root sends a DP (data prefix) packet to nodes lost in the busarbitration so as to notify that their requests have been rejected. Therequests from those nodes are held by the next bus arbitration.

Thus, the node that obtained the bus use permission starts datatransfer.

The sequence of the bus arbitration will be described with reference tothe flowchart of FIG. 11.

To start data transfer by a node, the bus must be in idle status. Toconfirm that data transfer has been completed and the bus is currentlyin idle status, each node detects a gap length of a predetermined idleperiod (e.g., sub-action gap) set in each transfer mode, and itdetermines whether or not the bus is currently in idle status based onthe detection result.

At step S401, the node determines whether or not a predetermined gaplength corresponding to asynchronous data or isochronous data to betransferred has been detected. So far as the node has not detected thepredetermined gap length, it cannot request a bus use right to startdata transfer, accordingly, the node waits until the predetermined gaplength has been detected.

When the predetermined gap length has been detected at step S401, thenode determines whether or not there is data to be transferred at stepS402. If YES, it issues a signal requesting a bus use right to the rootat step S403. As shown in FIG. 10A, this signal requesting the bus useright is relayed by the respective devices in the network, and forwardedto the root. If it is determined at step S402 that there is no data tobe transferred, the process returns to step S401.

At step S404, if the root has received a single or plurality of requestsignals for the bus use right, it examines the number of nodesrequesting the bus use right at step S405. From the determination atstep S405, if the number of the nodes requested the bus use right isone, that node is provided with bus use permission immediately after therequirement. On the other hand, if the number of the nodes is more thanone, arbitration is performed to determine one node to be provided withthe bus use right immediately after the requirement. The arbitrationdoes not always provide a bus use right to the same node, but equallyprovides a bus use right to the respective nodes (fair arbitration).

The processing at the root branches at step S407 into processing for thenode dominated in the arbitration at step S406, and processing for theother nodes lost in the arbitration. In a case where there is one nodethat requested the bus use right, or one node has dominated in thearbitration, the node is provided with an permission signal indicativeof bus use permission at step S408. The node starts data (packet)transfer immediately after it receives the permission signal (stepS410). On the other hand, the nodes lost in the arbitration receive a DP(data prefix) packet indicative of rejection of the bus use request atstep S409. The processing for the node that received the DP packetreturns to step S401 to request a bus use right again. Also, theprocessing for the node that completed data transfer at step S410returns to step S401.

[Transaction Layer]

The transaction layer includes a read transaction, a write transactionand a lock transaction.

In a read transaction, an initiator (requiring node) reads data from aspecific address in the memory of a target (response node). In a writetransaction, the initiator writes data into a specific address of thememory of the target. In a lock transaction, the initiator transfersreference data and update data to the target. The reference data iscombined with data of the address of the target, into a designationaddress to specify a specific address of the target. Data at thedesignation address is updated by the update data.

FIG. 27A shows a request-response protocol with read, write and lockcommands, based on the CSR architecture in the transaction layer. InFIG. 27A, the request, notification, response and confirmation areservice units in the transaction layer 814.

A transaction request (TR_DATA.request) is packet transfer to a responsenode; a transaction indication (TR_DATA.indication) is notification ofarrival of the request to the response node; a transaction response(TR_DATA.response) is transmission of acknowledgment; and a transactionconfirmation (TR_DATA.confirmation) is reception of acknowledgment.

[Link Layer]

FIG. 27B shows services in the link layer 812. The services are serviceunits of a link request (LK_DATA.request) to require packet transferfrom the response node, a link indication (LK_DATA.indication)indicating packet reception to the response node, a link response(LK_DATA.response) as acknowledgment transmitted from the response node,a link confirmation (LK_DATA.confirmation) as confirmation of theacknowledgment transmitted from the response node. One packet transferprocess is called a sub-action including an asynchronous sub-action andan isochronous sub-action. Hereinbelow, the respective operations of thesub-actions will be described.

[Asynchronous Sub-action]

The asynchronous sub-action is asynchronous data transfer.

FIG. 12 shows transition in the asynchronous transfer. In FIG. 12, thefirst sub-action gap represents the idle status of the bus. At a pointwhere the idle time has become a predetermined value, a node which is toperform data transfer requests a bus use right, then bus arbitration isexecuted.

When the use of bus has been allowed by the arbitration, data in theform of packet is transferred, and a node which receives the data sendsa reception acknowledgment code ACK as a response, or sends a responsepacket after a short gap called ACK gap, thus the data transfer iscompleted. The code ACK comprises 4-bit information and a 4-bitchecksum. The code ACK, including information indicative of success,busy or pending status, is immediately sent to the data-sender node.

FIG. 13 shows a packet format for asynchronous transfer. The packet hasa data area, a data CRC area for error correction, and a header area inwhich a destination node ID, a source node ID, a transfer data lengthand various codes are written.

The asynchronous transfer is one-to-one communication from a sender nodeto a receiver node. A packet sent from the sender node is relayed by therespective nodes in the network, however, as these nodes are notdesignated as the receiver of the packet, they ignore the packet, thenonly the receiver node designated by the sender node receives thepacket.

[Split Transaction]

The services in the transaction layer 814 are performed as a set oftransaction request and transaction response, as shown in FIG. 27A. Ifthe processings in the link layer 812 and the transaction layer 814 ofthe target (response node) are performed at a sufficiently high speed,the request and the response are not performed as independentsub-actions but as one sub-action in the link layer 812. However, if theprocessing speed of the target is low, the request and the response mustbe processed by independent sub-actions. This is called a splittransaction.

FIG. 28A shows an operation example of the split transaction. In FIG.28A, in response to a write request from a controller as an initiator(requiring node), a target returns a pending. The target returnsconfirmation information to the write request from the controller, thusgains time for data processing. When a sufficient period for the dataprocessing has elapsed, the target sends a write response to thecontroller, thus completes the write transaction. Note that another nodecan perform the operation of the link layer 812 between the request andresponse sub-actions.

FIG. 28B shows transitional statuses of transfer in case of the splittransaction. In FIG. 28B, a sub-action 1 represents the requestsub-action; and a sub-action 2, the response sub-action.

In the sub-action 1, the initiator sends a data packet indicative of thewrite request to the target, and the target receives the data packet,returns “pending” indicative of the confirmation of the aboveinformation, as an acknowledge packet. Then, the request sub-action iscompleted.

Then, when a sub-action gap has been inserted, the target sends a writeresponse as a data packet with no data, in the sub-action 2. Theinitiator receives the data packet, returns a “complete” response as anacknowledge packet. Then, the response sub-action is completed.

Note that the period from the completion of the sub-action 1 to thebeginning of the sub-action 2 can be minimized to a period correspondingto the sub-action gap, while maximized to a period corresponding to amaximum waiting period set in the nodes.

[Isochronous Sub-action]

Isochronous transfer, which can be regarded as the greatest feature ofthe 1394 serial bus is appropriate to multimedia data transfer whichrequires realtime transfer of, especially, AV data.

Further, the asynchronous transfer is one-to-one transfer, whereas theisochronous transfer is broadcasting transfer from one sender node toall the other nodes.

FIG. 14 shows transition in the isochronous transfer. The isochronoustransfer is executed on the bus in a predetermined cycle, called“isochronous cycle”. The period of the isochronous cycle is 125 μs. Acycle start packet (CSP) indicates the start of the isochronous cyclefor synchronizing the operations of the respective nodes. When datatransfer in a cycle has been completed and a predetermined idle period(sub-action gap) has elapsed, a node which is called “cycle master”sends the CSP indicative of the start of the next cycle. That is, thisinterval between the issuance of CSP's is 125 μs.

As channel A, channel B and channel C in FIG. 14, the respective packetsare provided with a channel ID, so that plural types of packets can beindependently transferred within one isochronous cycle. This enablessubstantially-realtime transfer among the plural nodes. The receivernode can receive only data with a predetermined channel ID. The channelID does not indicate an address of the receiving node, but merelyindicates a logical number with respect to the data. Accordingly, onepacket sent from a sender node is transferred to all the other nodes,i.e., broadcasted.

Similar to the asynchronous transfer, bus arbitration is performed priorto the packet broadcasting in isochronous transfer. However, as theisochronous transfer is not one-to-one communication like theasynchronous transfer, the reception acknowledgment code ACK used as aresponse in the asynchronous transfer is not used in the isochronoustransfer.

Further, an isochronous gap (iso gap) in FIG. 14 represents an idleperiod necessary for confirming prior to isochronous transfer that thebus is in idle status. If the predetermined idle period has elapsed, busarbitration is performed with respect to node(s) desiring isochronoustransfer.

FIG. 15A shows a packet format for isochronous transfer. Various packetsdivided into channels respectively have a data field, a data CRC fieldfor error correction and a header field containing information such as atransfer-data length, a channel No., various codes and error-correctionheader CRC as shown in FIG. 15B.

[Bus Cycle]

In practice, both isochronous transfer and asynchronous transfer can bemixedly performed on the 1394 serial bus. FIG. 16 shows transition inthe isochronous transfer and asynchronous transfer mixedly performed onthe 1394 serial bus.

The isochronous transfer is performed prior to the asynchronous transferbecause after the CSP, the isochronous transfer can be started with agap (isochronous gap) shorter than the idle period necessary forstarting the asynchronous transfer. Accordingly, the isochronoustransfer has priority over the asynchronous transfer.

In the typical bus cycle as shown in FIG. 16, upon starting the cycle#m, a CSP is transferred from the cycle master to the respective nodes.The operations of the respective nodes are synchronized by this CSP, andnode(s) that waits for a predetermined idle period (isochronous gap) toperform isochronous transfer participates in bus arbitration, thenstarts packet transfer. In FIG. 16, a channel e, a channel s and achannel k are transferred by the isochronous transfer.

The operation from the bus arbitration to the packet transfer isrepeated for the given channels, and when the isochronous transfer inthe cycle #m has been completed, the asynchronous transfer can beperformed. That is, when the idle period has reached the sub-action gapfor the asynchronous transfer, node(s) that is to perform theasynchronous transfer participates in bus arbitration. Note that only ifthe sub-action gap for starting the asynchronous transfer is detected,after the completion of isochronous transfer and before the next timingto transfer the CSP (cycle synch), the asynchronous transfer can beperformed.

In the cycle #m in FIG. 16, the isochronous transfer for three channelsis performed, and then two packets (packet 1 and packet 2) including ACKare transferred by the asynchronous transfer. When the asynchronouspacket 2 has been transferred, as the next cycle synch point to startthe subsequent cycle m+1 comes, the transfer in the cycle #m ends. Notethat during the asynchronous or isochronous transfer, if the next cyclesynch point to transfer the next CSP has come, the transfer is notforcibly stopped but continued. After the transfer has been completed, aCSP for the next cycle is transferred after a predetermined idle period.That is, when one isochronous cycle is continued for more than 125 μs,the next isochronous cycle is shorter than the reference period 125 μs.In this manner, the isochronous cycle can be lengthened or shortenedbased on the reference period 125 μs.

However, it may be arranged such that the isochronous transfer isperformed in every cycle, while the asynchronous transfer is sometimespostponed until the next cycle or the cycle further subsequent to thenext cycle, so as to maintain realtime transfer. The cycle master alsomanages information on such delay.

[FCP]

In an AV/C protocol, a Function Control Protocol (FCP) is provided tocontrol devices on the 1394 serial bus. For transmission of controlcommands and responses in the FCP protocol, an asynchronous packetdefined by the IEEE 1394 standards is employed. In the FCP protocol, anode on the controller side is called a controller, and a node on thecontrolled side, a target. An FCP packet frame sent from the controllerto the target is called an AV/C command frame; an FCP packet framereturned from the target to the controller, an AV/C response frame.

FIG. 29 shows a case where a node A is a controller and a node B is atarget. In the register address provided for the respective nodes, 512bytes from “0x0000B00” are assigned to a command register; and 512 bytesfrom “0x0000D00” are assigned to a response register. Data is writteninto the register of a designated address by a packet frame using theasynchronous transfer. The relation between the transmission of the AV/Ccommand frame by the controller and the response with the AV/C responseframe by the target is called an AV/C transaction. In a general AV/Ctransaction, a target which has received a command frame must send aresponse frame to a controller within 100 ms.

FIG. 30 shows the packet format for the asynchronous transfer includingan FCP packet frame. A command frame or a response frame is insertedinto a data area of the asynchronous data packet as shown in FIG. 15A,and the AV/C transaction is performed.

FIG. 31 shows the structure of the AV/C command frame. FIG. 32 shows thestructure of the AV/C response frame. As the FCP packet frame, an FCPdata part is arranged after “ctype”, “response”, “subunit_type” and“subunit_ID” in the header.

“ctype” indicates a command type in the command frame, with status“CONTROL”, “STATUS”, “INQUIRY” or “NOTIFY”.

“response” indicates a response code in the response frame, with status“ACCEPTED”, “REJECTED”, “IN_TRANSITION”, “IMPLEMENTED”, “CHANGED” or“INTERIM”.

Further, “subunit_type” indicates the classification of a device, and“subunit_ID” indicates an instance number.

The FCP data part has an operation code (opcode)+ operand (oprand)structure. The target is controlled and the AV/C response is performedby using various AV/C commands.

The operation code (opcode) in the command frame as shown in FIG. 31 isone of commands as shown in FIG. 41. The respective commands areperformed with contents according to the command types set at the“ctype”.

A command where the “ctype” designates the status “CONTROL” is a controlcommand used for controlling the target device or setting the target tothe content set after the operand (oprand). A command where the “ctype”designates the status “STATUS” is used for obtaining a statuscorresponding to the command. A command where the “ctype” designates thestatus “INQUIRY” is used for inquiring about contents which can be setby the command. A command where the “ctype” designates the status“NOTIFY” is used for performing confirmation of the command.

In each command, necessary content is set at the operand, and thecommand is written into the command frame.

In the operation code of the response frame, one of response codes asshown in FIG. 41 is set. Each response has an operand corresponding tothe response. As information indicating whether the execution of thecommand has been normally completed or ended with error, is set at theoperand, error processing can be performed in accordance with theoperand.

[Communication Using LOGIN Protocol]

FIG. 17 shows the interface of the 1394 serial bus in comparison withrespective layers of an OSI model often used in a LAN. In the OSI model,a physical layer 1 and a data link layer 2 respectively correspond to aphysical layer 811 and a link layer 812 (both shown in FIG. 2) in alower layer 4 of the 1394 serial bus interface. In the 1394 serial businterface, a transport protocol layer 5 and a presentation layer 6 asupper layers correspond to an upper layer 3 of OSI model including anetwork layer, a transport layer, a session layer and a presentationlayer. Further, a LOGIN protocol 7, operates between the lower layer 4and the transport protocol layer 5 of the 1394 serial bus interface.

In Example 1 in FIG. 17, by providing the LOGIN protocol 7 to a devicebased on a serial bus protocol (SBP-2) 8 for a peripheral device such asa printer, the peripheral device uses a protocol based on the protocolSBP-2 to notify a target device of data transfer with the target device.In Example 2, with respect to a device protocol 9 specialized on the1394 serial bus interface, by providing the LOGIN protocol 7 torespective devices, the devices can determine whether or not the targetdevice supports their protocol, with each other.

FIG. 18 shows the basic operation of the LOGIN protocol. When a printerdevice executes a print task 10 from a host device, the printer devicefirst selects one of printer protocols A to C for data communication,based on communication by the LOGIN protocol 7. Thereafter, the printerdevice performs print data transfer in accordance with the selectedprinter protocol. That is, upon connection between the printer devicewhich supports a plurality of printer protocols and a host device, theprinter device first judges the transport protocol 5 of the host devicebased on the LOGIN protocol 7, selects a printer protocol correspondingto the transport protocol 5 of the host device, and performstransfer/reception of print data or commands in accordance with theselected printer protocol, thus performs the print task 10.

FIG. 19 shows connection status in the 1394 serial bus, where devices(PC12, scanner 13 and VCR 14 etc.) with the LOGIN protocol 7 areconnected to a printer 11 corresponding to plurality of printerprotocols. The printer 11 can process print tasks from the respectivedevices by changing the printer protocol in accordance with thetransport protocol 5 of a device that requests connection with theprinter device.

FIG. 20 shows the flow of log-in operation.

At STEP 1:

-   -   The host device locks a target device (a multi-protocol printer        in this case).    -   The target device examines the capability of the host device        (including the transport protocol). Note that the capability has        been stored into a capability register 503 (to be described        later) of the host device.    -   The target device sets the capability (including the transport        protocol) of the host device.

At STEP 2:

-   -   Print data is transferred by the protocol determined at the STEP        1.

At STEP 3:

-   -   The host device disconnects the connection with the target        device.

FIG. 21 shows control/status register (CSR) which is prepared by aprinter as the target device so that the LOGIN protocol is installed,including a lock register 501, a protocol register 502 and thecapability register 503. These registers are provided in predeterminedaddresses in initial unit space in the address space of the 1394 serialbus. That is, as shown in FIG. 3, within the 48-bit address areaprovided to the devices, “0xFFFFF” in the first 20-bits is called“register space”, wherein a register (CSR core) as the core of the CSRarchitecture is arranged in the first 512 bytes. Note that informationcommon to devices connected via the bus is provided in this registerspace. Further, “0-0xFFFFD” is called “memory space”, and “0xFFFFE”,“private space”. The private space is an address which can be freelyused in the device for communication among the devices.

The lock register 501 indicates a locked status of a resource, with avalue “0” indicative of log-in enable status, and any value but “0”, analready-logged-in and locked status. The capability register 503indicates a protocol where each bit represents a protocol, with a value“1” bit indicating that a corresponding protocol can be set, while avalue “0” bit, that a corresponding protocol cannot be set. The protocolregister 502 indicates a currently set protocol. That is, each bit ofthe protocol register 502 corresponds to each bit of the capabilityregister 503, and the value of a bit of the protocol register 502corresponding to the set protocol is “1”.

FIG. 22 is a flowchart showing LOGIN processing in the host device.

To start the LOGIN processing, first, the data of the lock register 501,the protocol register 502 and the capability register 503 of a targetdevice e.g., a printer, to be logged-in, is checked by a readtransaction. At this time, from the data of the capability register 503,it is examined whether or not the target device supports a protocol usedby the host device for communication (step S601). If the target devicedoes not support the protocol of the host device, the LOGIN processingis terminated at step S602.

Further, if the data value of the lock register 501 is not “0”, it isdetermined that another device is in logged-in status, and the LOGINprocessing is terminated. If the data value of the lock register 501 is“0”, it is determined that log-in is currently possible (step S602).

In case of log-in enable status, the process moves to resource lockprocessing where the log-in is set by writing “1” into the lock register501 of the printer by using a lock transaction (step S603). The targetdevice is locked in this status, and it is uncontrollable from otherdevices and the register values cannot be changed.

As described above, in the status where the resource of the targetdevice is locked, protocol setting is performed next. As the printer asthe target device of the present embodiment supports a plurality ofprinter protocols, the printer must be informed of the protocol whichcan be used by the host device before it receives print data. In thepresent embodiment, the protocol to be used is notified to the printerby setting the corresponding bit of the protocol register 502 of theprinter by a write transaction (step S604).

At this point, as the protocol used by the host device for communicationhas been notified to the target device and the target device is inlocked status, the host device that is currently logged in the targetdevice performs data (print data in this case) transfer (step S605).

As the data transfer has been completed, the host device logs out fromthe printer by clearing the lock register 501 and the capabilityregister 503 of the target device (step S606).

FIG. 23 is a flowchart showing the LOGIN processing in the printer asthe target device.

The printer generally waits for log-in from a host device. As a printrequest from a host device is started by reading data values from thelock register 501, the protocol register 502 and the capability register503 of the printer, the registers must be in read-enable status. Thisprocessing will be described on the assumption that a host device whichis to perform printout has locked the printer (step S701).

The printer waits for notification of an available protocol from thehost device (step S702). The printer receives the notification ofavailable protocol in locked status so as to maintain the protocolregister 502 unchanged by another device's request in mid-course of thelog-in processing.

When the available protocol has been assigned (step S703), the printerswitches its own protocol to the notified protocol (steps S704, S706 andS708), and performs communication in accordance with the protocol of thehost device (steps S705, S707 and S709).

When the communication has been completed, the printer confirms that thelock register 501 and the capability register 503 have been cleared(step S710), and returns to the log-in waiting status (step S701).

[Example in Consideration of Device without LOGIN Protocol]

FIG. 24 is an explanatory view showing a case in consideration of adevice without the LOGIN protocol 7. Compared with the first example asshown in FIG. 18, this example is applicable to a device having aprotocol D in which the LOGIN protocol 7 is not installed. That is, toassure the device only corresponding to the conventional protocol D(e.g., AV/C protocol) of print operation, as well as devices having theLOGIN protocol 7, the printer side has the protocol D.

In this case, if the printer recognizes, by a print request performed atthe beginning of connection, that the host device does not correspond tothe LOGIN protocol 7, the printer tries communication with the hostdevice by using the protocol D, and if the communication can beestablished, the printer executes the print task 10 in accordance withthe protocol D.

FIG. 25 shows the IEEE 1394 serial interface according to this examplein comparison with the OSI model. Example 3 uses, as a model, an AVdevice 15 based on the AV/C protocol. In the AV device 15, the LOGINprotocol 7 is not installed. Example 4 uses, as a model, a scanner 16,in which the LOGIN protocol 7 is not installed, but a non-standardprotocol for scanner is installed.

That is, regarding a device in which the LOGIN protocol 7 is notinstalled, if the printer can perform communication using the protocolof the device, the printer can perform print task from the device. Thisincreases the types of devices that can use the printer.

[Direct Print Control]

Hereinbelow, print procedures in the printer and the image providingdevice will be described. In this case, a Direct Print Protocol (DPP),is employed as a protocol to directly connect the printer and the imageproviding device, and enable the printer to form an image based on imagedata provided from the image providing device.

The DPP protocol basically comprises a command register (command) forwriting a command in the initial unit space (the unit space in FIG. 3),a response register (response) for writing a response to the command, adata register (data) for writing transfer data, and a format register(format) for handling format information corresponding to data formatfor each transfer data.

FIG. 33 shows a register map in which the command register and theresponse register are the same as those described in FIG. 29. In thefollowing description, the image providing device as a controllerprovides image data to the printer as a target and an image is printedbased on the image data.

A command register 42-1, arranged from a fixed address “0xFFFFF0000B00”on the printer side, has a 512 byte memory space into which the imageproviding device writes various commands for the printer. If the imageproviding device side also has a command register, the printer can writecommands into the register. The command written into the commandregister is called a command frame.

A response register 42-2, arranged from fixed address “0xFFFFF0000D00”,has a 512 byte memory space into which a response is written withrespect to the various commands written from the image providing deviceto the printer. If the printer side also has a response register, theimage providing device can write a response into the register. Theresponse written into the response register 42-2 is called a responseframe. Note that in FIG. 29, the upper address part “0xFFFF” is omitted.

A data register 42-3, having a default address “FFFFF0003000h”, is setat an arbitrary effective address by commands “BlockAddress” and“BufferConfig” (commands to define the address of the data register).The memory space of the data register 42-3 is set with a rangepredetermined by commands “BlockSize” and “BufferConfig” (commands todefine the memory space of the data register). The data register 42-3 isused for data transfer between the image providing device and theprinter. Upon printing, the image providing device writes print data forthe printer into this register. The print data is based on a pre-setimage format. The data written into the data register 42-3 is called adata frame.

A format register 42-2 is a set of registers corresponding to variousdata formats to be described later. The respective registers are usedfor setting format information necessary for the respective dataformats. That is, the format register 42-2 is used for writing theformat information for the printer from the image providing device. Theformat information written into the format register 42-2 is called aformat frame.

FIG. 34 shows the flow of frames from the image providing device to theprinter, i.e., shows the flow of the command frame, the response frame,data frame and the format frame. The printer performs printing inaccordance with the frames outputted from the image providing device.

A command sent from the image providing device to the printer is writtenas a command frame into a command register 43-4 of the printer. Thecommand is used for printing, as shown in FIG. 41. A response to thiscommand is written by the printer into a response register 43-2 of theimage providing device. The response includes information indicatingwhether or not the command has been properly executed, a return value tothe command and the like. Print data sent from the image providingdevice to the printer is written into a data register 43-6 of theprinter. Format information sent from the image providing device to theprinter is written as a format frame into a format register 43-7 of theprinter.

FIG. 35 shows the construction of the format register 43-7. The formatregister 43-7 includes a read only register INQUIRY 44-1 for inquiry anda read/write register CONTROL/STATUS 44-2 for setting and informationacquisition. The registers INQUIRY 44-1 and the CONTROL/STATUS 44-2comprise register groups of the same structure. That is, the INQUIRY44-1 has registers 44-3 to 44-7, while the CONTROL/STATUS 44-2 hasregisters 44-9 to 44-13.

More specifically, the format register group includes the registers 44-3and the 44-4 (44-9 and 44-10) constituting a print common registergroup, and the registers 44-5 to 44-7 (44-11 to 44-13) constituting aprinter format register group.

The common register group, which is a group of registers common to allthe data formats, has the register GLOBAL 44-3 (44-9) common to all theprinters and the register LOCAL 44-4 (44-10) unique to each printer.

The printer format register group is a group of n registers unique tothe respective data formats, i.e., the register format[1] 44-5 (44-11)to the register format[n] 44-7 (44-13). The registers format[1] toformat[n] correspond to data formats to be described later. One of theprinter format register group is assigned to each installed data format.

Note that the address of each format register is provided to the imageproviding device as a response to a command for setting a data format.

FIG. 36 shows the detailed construction of the status register 44-8 ofthe common register group. The status register 44-8 comprises a 32-bitcommon status register 45-1 holding a status common to the respectivevendor printers and a 32-bit vendor specific status register 45-2holding a status defined by each vendor. Further, the extension of thevendor specific status register 45-2 is defined as follows, by a v flag(vendor status available flag) at the 31th bit of the common statusregister 45-1:

-   -   v flag:        -   “0” =not available        -   “1” =available

Further, information held in the common status register 45-1 is asfollows:

error.warning: status of error, warning and the like

paper state: status on print sheet

print state: status on printing situation

FIG. 37 shows the details of information held in the register GLOBAL44-3 (44-9) of the common register group. The register GLOBAL 44-3(44-9) holds information common to all the printers having the DPP(Direct Print Protocol), i.e., information which does not differ inprinter type. FIG. 37 shows an example of the information, includingmedia-type 46-1 indicative of the type of print medium, paper-size 46-2indicative of a print sheet size, page-margin 46-3 indicative of a pagemargin value, page-length 46-4 indicative of a page length, page-offset46-5 indicative of page offset, print-unit 46-6 indicative of printerunit information, color-type 46-7 indicative of the color type ofprinter, bit-order 46-8 indicative of the bit order of data, and thelike.

FIG. 38 shows the details of information held in the register LOCAL 44-4(44-10) of the common register group. The register LOCAL 44-4 (44-10)holds information unique to each of the printers having the DPPprotocol, i.e., information which differs in printer type. FIG. 38 showsan example of the information, including paper 47-1 indicative of thetype of print sheet of a printer, CMS 47-2 indicative of a colormatching method, ink 47-3 indicative of ink type of the printer, e.g.,an ink-jet printer.

FIG. 39 shows the details of information held in the register format[1]44-5. In FIG. 39, information on EXIF (Exchangeable Image File Format)as one image data format is held. The information includes inX-rate 48-1indicative of the rate of X-directional input, inY-rate 48-2 indicativeof the rate of Y-directional input, outX-rate 48-3 indicative of therate of X-directional output, and outY-rate 48-4 indicative of the rateof Y-directional output. In this case, printing is performed byenlarging/reducing given EXIF image data in the XY directions inaccordance with the respective contents of the register.

FIG. 40 shows the details of information held in the register format[2]44-6. In FIG. 40, information on Raw RGB as one image format is held.The Raw RGB format has a structure to represent each pixel by R (red), G(green) and B (blue) data. The information includes inX-rate 49-1indicative of the rate of X-directional input, inY-rate 49-2 indicativeof the rate of Y-directional input, outX-rate 49-3 indicative of therate of X-directional output, outY-rate 49-4 indicative of the rate ofY-directional output, XY-size 49-5 indicative of an XY-directional fixedpixel size, bit-pixel 49-6 indicative of the number of bits per pixel,X-size 49-7 indicative of the number of pixels in the X direction,Y-size 49-8 indicative of the number of pixels in the Y direction, plane49-9 indicative of the number of color planes, X-resolution 49-10indicative of X-directional resolution, Y-resolution 49-11 indicative ofY-directional resolution, pixel-format 49-12 indicative of pixel type,and the like. In this case, printing is performed by enlarging/reducinggiven Raw RGB format image data and/or changing the resolutions in theXY directions in accordance with the respective contents of theregister, further, processing the image data based on image sizeinformation and the like.

FIG. 41 shows commands and responses to the commands. The commands areclassified based on several types, i.e., “status” type commands relatingto status, “control” type commands for printer control, “block/buffer”type commands for data transfer setting, “channel” type commands forchannel setting, “transfer” type commands relating to a transfer method,“format” type commands relating to format setting, “login” type commandsrelating to log-in, “data” type commands relating to data transfer, andthe like. Note that the log-in, “login” type commands as aforesaid, anda command Login, a response LoginResponse, a command Logout and aresponse LogoutResponse described later are unrelated to the LOGINprotocol as aforementioned.

More specifically, the “status” type commands include a commandGetStatus to obtain the status of a printer and its responseGetStatusResponse 50-1 and the like.

The “control” type commands include a command PrintReset to reset theprinter and its response PrintResetResponse 50-2, a command PrintStartto instruct to start printing and its response PrintStartResponse 50-3,a command PrintStop to instruct to stop printing and its responsePrintStopResponse 50-4, a command InsertPaper to instruct to supply aprint sheet and its response InsertPaperResponse 50-5, a commandEjectPaper to instruct to discharge a print sheet and its responseEjectPaperResponse 50-6, a command CopyStart to instruct to startcopying image data and its response CopyStartResponse 50-7, a commandCopyEnd to instruct to terminate copying image data and its responseCopyEndResponse 50-8, and the like.

The “block/buffer” type commands include a command BlockSize todesignate a block size and its response BlockSizeResponse 50-9, acommand BlockAddress to designate a block address and its responseBlockAdressResponse 50-10, a command FreeBlock to obtain the number ofavailable blocks and its response FreeBlockResponse 50-11, a commandWriteBlocks to instruct to write data into blocks and its responseWriteBlocksResponse 50-12, a command BufferConfig to designate bufferinformation and its response BufferConfigResponse 50-13, a commandSetBuffer to designate to start obtaining data from buffer and itsresponse SetBufferResponse 50-14, and the like.

The “channel” type commands include a command OpenChannel to open achannel and its response OpenChannelResponse 50-15, a commandCloseChannel to close the channel and its response CloseChannelResponse50-16, and the like.

The “transfer” type commands include a command TransferMethod todesignate a data transfer method and its response TransferMethodResponse50-17 and the like.

The “format” type commands include a command SetFormat to set a formatand its response SetFormatResponse 50-18 and the like.

The “login” type commands include a command Login to perform log-in andits response LoginResponse 50-19, a command Logout to perform log-outand its response LogoutResponse 50-20, a command Reconnect to performreconnection and its response ReconnectResponse 50-21, and the like.

These commands are written into a command frame.

Further, the “data” type commands include commands WriteBlock 50-22 andWriteBuffer 50-23 to write data, a command PullBuffer 50-24 to readdata, and the like. These commands are written/read with respect to adata frame, and there have no responses corresponding to these commands.

The image providing device sets a value corresponding to each of thevarious commands as shown in FIG. 41 at the operation code (opcode), andwrites the command into the command register 43-4 of the printer. Thus,the command is executed by the printer. The response to the command hasthe same value as that of the command. The printer sets the response atthe operation code of the response frame as shown in FIG. 32, and writesthe frame into the response register 43-2 of the image providing device.By the response, the image providing device receives the result ofexecution of the command.

FIG. 42 shows the image data formats supported by the DPP protocol. Theprinter must support Raw image data of at least one of these formats.Further, the printer can support other plural formats as optionalformats.

FIG. 43 shows the flow of format setting processing. First, the imageproviding device sends the command SetFormat (INQUIRY) to the printer atstep S500, and the printer returns the SetFormatResponse at step S501.The image providing device obtains the address of the INQUIRY registerof the printer by the returned response.

Next, the image providing device sends the command SetFormat(CONTROL/STATUS) to the printer at step S502, and the printer returnsthe SetFormatResponse at step S503. The image providing device obtainsthe address of the CONTROL/STATUS register of the printer by thereturned response.

The image providing device reads the INQUIRY register of the printer atsteps S504-1 to S504-m, and obtains the format supported by the printerand set items of the format. Next, the image providing device reads theSTATUS/CONTROL register of the printer at steps S505-1 to S505-n,obtains the set values of the format, then writes data into theSTATUS/CONTROL register of the printer, thus sets the format.

The data transfer in the DPP protocol uses the following two packets.

-   -   Control command packet for flow control    -   Packet for data transmission

In the present embodiment, the following five types of data transfermethods are used in accordance with the difference among datatransmission methods and flow controls. In any method, control commandsfor the flow control are based on the FCP protocol. However, The controlcommands are not limited to the FCP protocol.

-   -   Transfer method 1: Response model    -   Transfer method 2: Simplified response model    -   Transfer method 3: PUSH large buffer model    -   Transfer method 4: PULL buffer model    -   Transfer method 5: Isochronous model

In actual transfer, one of the above methods is selected and set in aprocedure similar to the format setting procedure as shown in FIG. 43.Note that as shown in FIG. 44, the command TransferMethod and theresponse TransferMethodResponse are employed.

FIG. 44 shows the flow of data-transfer method setting processing. Theimage providing device obtains a currently available data transfermethod of the printer by the command TransferMethod and the responseTransferMethodResponse in the command type INQUIRY (steps S600-1 andS600-2), and obtains and sets a data transfer method currently set atthe printer, by the command TransferMethod and the responseTransferMethodResponse of the command type CONTROL/STATUS (steps S600-3and S600-4).

In any of the above five type of transfer methods, the control commandsfor flow control are based on the FCP protocol as a protocol forcontrolling a device on the 1394 serial bus. The transfer of controlcommand by the FCP protocol is always performed by an asynchronous writetransaction, in both transmission and response.

FIG. 45 shows a register map of registers necessary for the transfermethod 1 and the transfer method 2, in address space of the 1394 serialbus. In the present embodiment, a node on the controller side is theimage providing device (controller in the FCP protocol), and a node onthe controlled side is the printer (target in the FCP protocol).

Both image providing device and printer have a command register (601-1and 601-7) with offset of 512 bytes from “0x0B00” and a responseregister (601-2 and 601-8) with offset of 512 bytes from “0x0D00” in theregister space. These registers are based on the FCP protocol and theAV/C commands.

The flow control is made by writing the command frame 601-4 and theresponse frame 601-5 into the command register (601-1 and 601-7) and theresponse register (601-2 and 601-8), respectively. Further, for printdata transfer, a dedicated data frame is defined. That is, a dataregister (601-3 and 601-9) for a block size is provided from offset“0x3000” in the register space, and print data is transferred by writinga data frame 601-6 into the data register (601-3 and 601-9). Note thatthe block size is 512 bytes, for example.

FIG. 46 shows a data packet frame comprising a data header 602-1, a datapayload 602-2 and the like.

FIG. 47 shows the structure of the data header 602-1. In the data header602-1, upper 8 bits are assigned to a block count area 603-1, and lower8 bits, to a future reserve area 603-2. The block count area 603-1 isinternally used by the target (printer) to count the number of blockstransferred at one block transfer. Note that as the block count area603-1 has 8 bits, it takes a value “0” to “255”.

FIG. 48 shows data packet frame processing in the printer in blocktransfer. A data packet received by the printer is first written into adata register 604-1 of the printer. The printer has buffers (604-2 to604-5) of the same size of that of the data packet. The data packetwritten in the data register 604-1 is sequentially moved to thesebuffers (604-2 to 604-5). Note that the number of the data buffers ispreferably 255, the maximum block count value, but it may be a valueless than 255. The respective buffers correspond to block count values.A data packet when the block count value is “0” is stored into a bufferof Block[0]; and a data packet when the block count value is “1” isstored into a buffer of Block[1]. The data header 602-1 is removed fromthe data packets stored in the buffers (604-2 to 604-5), and the datapackets are developed in a memory space 604-6 of the printer.

[Transfer Method 1]

The transfer method 1 as the response model defines a data packet framefor data transmission, provides a data register, performs flow controlby control commands, while transfers print data by a write transaction.

FIG. 49 shows commands and responses FreeBlock in the transfer method 1.In the transfer method 1, prior to data transfer, the image providingdevice uses the commands and responses FreeBlock to obtain informationindicating the number of data packets to be transferred.

The image providing device transfers the FreeBlock command by a writetransaction (step S605-1), and the printer returns an ACK packetindicative of the acknowledgment of the transaction (step S605-2). Theprinter returns the FreeBlockResponse to notify a FreeBlockCount (stepS605-3) which is the number of currently available blocks, and the imageproviding device returns an ACK packet indicative of the acknowledgmentof the transaction (step S605-4).

FIG. 50 shows the flow of data transfer in the transfer method 1. Theimage providing device logs in the printer by the command and responseLogin of the DPP protocol (steps S606-1 and S606-2), and sets a formatto be used for data transfer by using the above-described formatregister group (step S606-3). Thereafter, the image providing deviceopens a logic channel by the command and response OpenChannel (stepsS606-4 and S606-5). Next, data transfer is started, and print data istransferred in the data packet format as shown in FIG. 46. Further, thepacket transfer is performed in correspondence with the number of blocksthe same as the number of data buffers on the printer side, as shown byreferences 604-2 to 604-5 in FIG. 48, as one cycle.

In the transfer method 1, the print data is transferred as follows. Theimage providing device obtains the FreeBlockCount of the printer by thecommand and response FreeBlock (steps S606-6 and S606-7), andsequentially transfers data packets of the same number as that of theFreeBlockCount, by the command WriteBlock (step S606-8). Note that thecommand WriteBlock is used for transferring print data packets from thedata register 601-3 of the image providing device to the data register601-9 of the printer. Note that there is no response corresponding tothe command WriteBlock, and the printer returns an ACK packet to confirmthat the data packets have been stored into the data register 601-9.

Then, block transfer is performed by repeating packet transfer, with thecommands WriteBlock of the same number of the FreeBlockCount and ACKpackets corresponding to the commands until all the series of print datahas been outputted from the image providing device, and between therespective block transfers, the FreeBlockCount of the printer isobtained by the command and response FreeBlock.

When the print data transfer has been completed, the image providingdevice closes the logic channel by the command and response CloseChannel(steps S606-10 and S606-11), and logs out from the printer by thecommand and response Logout of the DPP protocol (steps S606-12 andS606-13).

[Transfer Method 2]

The transfer method 2 as the simplified response model performs datatransfer in the same procedure as that of the transfer method 1 exceptthe method to obtain the FreeBlockCount.

FIG. 51 shows the flow of data transfer in the transfer method 2. Theimage providing device logs in the printer by the command and responseLogin of the DPP protocol (steps S607-1 and S607-2), and sets a formatto be used for data transfer by using the above-described formatregister group (step S607-3). Thereafter, the image providing deviceopens a logic channel by the command and response OpenChannel (stepsS607-4 and S607-5). Next, data transfer is started, and print data istransferred in the data packet format as shown in FIG. 46. Further, thepacket transfer is performed in correspondence with the number of blocksthe same as the number of data buffers on the printer side, as shown byreferences 604-2 to 604-5 in FIG. 48, as one cycle.

In the transfer method 2, the print data is transferred as follows. Theimage providing device obtains the FreeBlockCount of the printer of theprinter by the command WriteBlocks and response WriteBlockResponse(steps S607-6 and S607-7). Note that the response at step S607-7 is ofthe INTERIM type for performing the acquisition of the FreeBlockCountonly by the response from the printer side. The image providing devicesequentially transfers data packets of the same number as the obtainedFreeBlockCount, by the command WriteBlock (step S607-8), and the printerreturns the above-described ACK packet (607-9). Then, block transfer isperformed by repeating packet transfer by the commands WriteBlock of thesame number as the FreeBlockCount and ACK packets corresponding to thecommands until all the series of print data has been outputted from theimage providing device. Note that at the second cycle and the subsequentcycles in the block transfer, the FreeBlockCount is notified to theimage providing device by the WriteBlocksResponse from the printer, atthe end of each block transfer cycle (step S607-10). TheWriteBlocksResponse is of the CONTINUE type used for continuing theacquisition of the FreeBlockCount only by the response from the printer.

When the print data transfer has been completed, the image providingdevice closes the logic channel by the command and response CloseChannel(steps S607-11 and S607-12), and logs out from the printer by thecommand and response Logout of the DPP protocol (steps S607-13 andS607-14).

[Method to Obtain FreeBlockCount]

Hereinbelow, the method to obtain the FreeBlockCount, which is thedifference between the transfer method 1 and the transfer method 2, willbe described in detail.

FIG. 52 shows the commands and responses FreeBlock in the transfermethod 1 at steps S606-6 and S606-7, in detail, including the ACKpackets of the write transaction omitted in FIG. 50. In this case, bothinitiator device (image providing device) and the target device(printer) perform processing of the link layer and transaction layer ata relatively low speed.

When the image providing device writes the command FreeBlock into thecommand register by a write transaction (step S608-1), theabove-described ACK packet indicative of “pending” is returned from thelink layer of the printer (step S608-2). Next, the image providingdevice sends a command FreeBlock with no data (step S608-3), andreceives an ACK packet indicative of “complete” from the printer (stepS608-4). Thus, one write transaction ends.

Next, the printer returns the FreeBlockResponse. Similar to the commandFreeBlock at step S608-1, the FreeBlockResponse is written as a responseincluding the FreeBlockCount into the response register (step S608-5).An ACK packet indicative of “pending” is returned from the link layer ofthe image providing device (step S608-6). Then, the printer sends theFreeBlockResponse with no data (step S608-7), and receives an ACK packetindicative of “complete” (step S608-8). Thus, one write transactionends.

On the other hand, in the transfer method 2, only the FreeBlockResponsefrom the printer is used to obtain the FreeBlockCount at the second andthe subsequent cycles in the print data block transfer. Accordingly, theFreeBlockCount is obtained only by the operation at steps S608-5 toS608-8.

The acquisition of the FreeBlockCount is necessary at each cycle ofblock transfer. Accordingly, in the transfer method 2, the number ofpackets transferred on the bus can be less than that in the transfermethod 1.

FIG. 53 shows the commands WriteBlock in the transfer method 1 and thetransfer method 2in detail. As the command WriteBlock requires noresponse, commands in this procedure are sent in the order, theWriteBlock (step S609-1), an ACK packet indicative of “pending” (stepS609-2), the WriteBlock with no data (step S609-3) and an ACK packetindicative of “complete” (step S609-4). The length of the procedure isthe half of that in the case where commands and responses aretransferred. This performs data transfer at a relatively high speed evenif the processings in the link layer and the transaction layer areperformed at a relatively slow speed.

FIG. 54 shows the command WriteBlock in the transfer method 1 and thetransfer method 2 in detail, in a case where the processings in the linklayer and the transaction layer are performed at a sufficiently highspeed. In this case, commands in this procedure are sent in the order,the WriteBlock (step S610-1), and an ACK packet indicative of “complete”(step S610-2). This performs more efficient data transfer.

FIG. 55 shows the flow of WriteBlock error processing upon occurrence ofbus reset. In this case, the bus reset occurs at transfer of n-th(=0–255) packet at one block transfer cycle. In a write transaction, afailure of data packet transfer is indicated by an ACK packet, however,error upon bus reset cannot be detected. Then, in the presentembodiment, error processing is performed in the following procedure.That is, in a case where the FreeBlockCount is obtained (step S611-1),then the WriteBlock is sent n times (step S611-2 to S611-6), if busreset occurs at this time (step S611-7), the image providing deviceagain sends the WriteBlock[n] immediately before the bus reset (stepS611-8), and thereafter, continues the processing (steps S611-9 toS611-14).

[Transfer Method 3]

FIG. 56 shows the construction of command registers, response registersand data registers of the image providing device and the printer, in thePUSH large buffer model.

The commands and responses between the image providing device and theprinter based on the FCP protocol are executed by operation of writing acommand frame 65-7, as command request data, from a command register65-1 of the image providing device into a command register 65-4 of theprinter, and operation of writing a response frame 65-8, as responsedata, from a response register 65-5 of the printer into a responseregister 65-2 of the image providing device.

Further, different from the FCP protocol, a data frame 65-9 is used inone-directional operation of writing image data from a data register65-3 of the image providing device into a data register 65-6 of theprinter by using a write transaction.

FIG. 57 shows the flow of operation of the PUSH buffer model between theimage providing device and the printer.

Note that the commands Login, Logout, OpenChannel and CloseChannel andformat setting are similar to those in the above-described transfermethod 1, therefore, detailed explanations of the commands and theformat setting will be omitted.

In FIG. 57, the image providing device inquires about the buffer area ofthe printer by the command BufferConfig indicating “INQUIRY” (stepS1701). The printer returns the buffer size and buffer address by theBufferConfigResponse (step S1702).

Next, the image providing device sets the buffer size and the bufferaddress of the printer into which data is written, by the commandBufferConfig indicating “CONTROL” (step S1703). The printer returns theBufferConfigResponse indicating that the setting has been completed(step S1704).

Next, the image providing device notifies the printer that data transferis to be started, by using the command SetBuffer indicating “NOTIFY”(step S1705). The printer returns the “INTERIM” SetBufferResponseindicating that the printer is prepared for the present to receive thedata (step S1706), to let the image providing device start datatransfer. Then, the printer notifies the image providing device that thedata transfer to the initially set buffer area has been completed, byusing the SetBufferResponse indicating “CONTINUE” (step S1709).

The command WriteBuffer at step S1707 indicates data frame writing bythe image providing device. In this operation, data is sequentiallywritten into the buffer address set in the printer.

A response WriteTransactionResponse at step S1708 indicates a responsepacket upon isochronous transfer of data frame. As described above, ifthe data input speed of the printer is sufficiently high, the processingcan be completed by using an acknowledgment of one write transaction,however, if data input takes time, independent responses occur as asplit transaction.

Step S1710 indicates processing of transferring a plurality of dataframes. That is, the data is transferred by a series of transactions toan area having the buffer size set by using the command BufferConfig.The data transfer method using a series of transactions is called a“PUSH data transfer method” or abbreviated to a “PUSH method”.

FIG. 58 shows the structure of a data packet in the data frame. As thedata can be written by directly addressing the buffer of the printer, adata packet 67-1 does not include a header and the like.

FIG. 59 shows the relation between the data register and the buffer ofthe printer. Data written in a data register 68-1 is directly writteninto the address of a memory space 68-2 of the printer, designated by“BufferAddress” determined by an offset “Destination_Offset”. As theoffset value is incremented by a data length indicated by “Data_Length”,the data is continuously written within the area indicated by“BufferSize” by repeatedly writing the data into the series of bufferaddresses.

[Transfer Method 4]

FIG. 60 shows the construction of the command registers, the responseregisters and the data registers of the image providing device and theprinter, in the PULL buffer model.

The commands and responses between the image providing device and theprinter, based on the FCP protocol, are executed by operation of writinga command frame 69-7, as command request data, from a command register69-1 of the image providing device into a command register 69-4 of theprinter, and operation of writing a response frame 69-8, as responsedata, from a response register 69-5 of the printer into a responseregister 69-2 of the image providing device.

Further, different from the FCP protocol, a data frame 69-9 is used inone-directional operation of reading image data from a data register69-3 of the image providing device into a data register 69-6 of theprinter by using a read transaction.

FIG. 61 shows the flow of operation of the PULL buffer model between theimage providing device and the printer. Note that the commands Login,Logout, OpenChannel and CloseChannel and format setting are similar tothose in the above-described transfer method 1, therefore, detailedexplanations of the commands and responses BufferConfig and SetBuffer(steps S1711 to S1714), which are the same as those in theabove-described transfer method 3, will be omitted.

In FIG. 61, the image providing device notifies the printer that datatransfer can be started by using the command SetBuffer indicating“NOTIFY” (step S1715). The printer returns the “INTERIM”SetBufferResponse indicating that the printer is prepared to receivedata (step S1716) for the present, and let the image providing devicestart data transfer. Then, the printer notifies the image providingdevice that data transfer into the initially set buffer area has beencompleted, by using the SetBufferResponse indicating “CONTINUE” (stepS1719).

The printer requires a read transaction by a command PullBufferRequest(step S1717). Then the image providing device transfers data by aPullBufferResponse packet (step S1718), thus data is sequentiallywritten into the buffer address set in the printer.

Step S1720 indicates processing of transferring a plurality of dataframes. That is, the data is transferred by a series of readtransactions to the area having the buffer size set by using the commandBufferConfig. The data transfer method using a series of transactions iscalled a “PUSH data transfer method” or abbreviated to a “PUSH method”.

FIG. 62 shows the relation between the data register and the buffer ofthe image providing device. Data is read from a memory space 72-2 of theimage providing device designated by “BufferAddress” determined by anoffset “Destination_Offset” set in the data register 71-1. As the offsetvalue is incremented by a data length indicated by “Data_Length”, thedata is continuously read from the area indicated by “BufferSize” byrepeatedly writing the data into the series of buffer addresses.

[Transfer Method 5]

In the transfer method 5 as the Isochronous model, the print datatransfer by using the asynchronous transaction in the above-describedtransfer method 1 is replaced with print data transfer by using anisochronous transaction. Note that the structure of a data packet is thesame as that shown in FIGS. 46 and 47. Further, the data packet frameprocessing in the printer upon block transfer is the same as that inFIG. 48.

Note that according to the present transfer method, data transfer can bemade at predetermined time by using an isochronous write transaction.

Further, in the block transfer, if an error occurs upon transferringprint data for one page at once, it takes a long time to re-transfer theprint data for one page. However, if print data is transferred in morefine block units, e.g., print-band units of an ink-jet printer, printdata re-transfer due to the occurrence of error can be efficientlyperformed.

FIG. 63 shows command registers and response registers for flow control.The image providing device writes a command frame into a commandregister 75-3 of the printer by an asynchronous write transaction. Theprinter writes a response frame to the command into a response register75-2 of the image providing device by an asynchronous write transaction.

FIG. 64 shows the flow of print processing. First, similar to theabove-described transfer method 1, the image providing device sends thecommand Login to the printer (step S507). The printer returns theLoginResponse (step S508), thus connection is established.

Next, similar to the above-described transfer method 1, the imageproviding device performs format setting (step S509), and sends thecommand OpenChannel to the printer (step S510). The printer returns theOpenChannelResponse (step S511), thus a logic channel is opened.

Then, the image providing device sends the command FreeBlock to theprinter (step S512). The printer returns the FreeBlockResponse (stepS513). The FreeBlockResponse includes the number of FreeBlock andErrorStatus. The number of FreeBlock is the number of block buffersensured in block units in the memory space of the printer. TheErrorStatus is used to notify the image providing device of errorinformation in previous block transfer. Note that the printer alwaysreturns “normal” as the ErrorStatus to the first command FreeBlock afterthe logic channel has been opened.

Then, the image providing device block-transfers print data by anisochronous transaction (step S514). At this time, the image providingdevice sends data packets of the number corresponding to theFreeBlockCount.

Next, the image providing device sends the command FreeBlock to theprinter (step S515). The printer returns the FreeBlockResponse (stepS516). If the ErrorStatus of the response indicates “abnormal”, i.e., ifan error has occurred at the previous block transfer, the imageproviding device sends the data transferred at step S514 again (stepS517). Thereafter, the processing at steps S515 to S517 is repeateduntil the data transfer has been normally completed. Further, if theErrorStatus indicates “normal”, the image providing device sends datapackets of the number indicated by the FreeBlockCount included in theFreeBlockResponse (step S517).

Note that the printer determines whether or not an error has occurred byreferring to the block count of the header in transferred data (FIG.64). Further, if the FreeBlockCount is greater than the number of blocksof data to be transferred, the image providing device sends dummypackets of a number corresponding to the excessive blocks.

Then, data transfer by an isochronous transaction is repeated until allthe series of print data have been outputted from the image providingdevice.

When the data transfer has been completed, similar to theabove-described transfer method 1, the image providing device closes thelogic channel by the command and response CloseChannel (steps S518 a andS519), and logs out from the printer by the command and response Logoutof the DPP protocol (steps S520 and S521).

As described above, according to the present embodiment, the imageproviding device and the printer are directly connected by using the1394 serial bus or the like, and image data is directly sent from theimage providing device to the printer, so that the printer prints animage based on the image data.

Further, as control commands and print data are separated, theembodiment provides an efficient data transfer methods in the 1394serial bus or the like.

Further, the embodiment provides a data transfer method which recovers atransfer error in the 1394 serial bus.

Further, the embodiment provides a data transfer method in whichdetermination whether or not data can be written into the register areais unnecessitated by notification of the number of available blocks of aregister area for data transfer, and the overhead necessary for thedetermination is removed. Further, the embodiment provide an efficientdata transfer method since as data for the notified number of availableblocks is transmitted and received.

Further, according to the embodiment, a data transfer method appropriateto a transfer destination device can be selected from a plurality ofdata transfer methods.

Further, the embodiment provides a data transfer method which avoidsdegradation of transfer efficiency due to command transmission upon datatransfer from a host device to a target device, by only using a commandinstructing to start data transmission and a response to the command,i.e., transmitting no command after the start of the data transfer.

Further, the embodiment provides a data transfer method based on thePUSH method or PULL method upon data transfer between a host device anda target device.

Further, the embodiment provides a data transfer method which performsisochronous transfer and asynchronous transfer in the same transferprocedure upon data transfer between a host device and a target device.

Further, the embodiment provides a data transfer method in which, when atransfer error occurs at a certain part of data in isochronous transfer,performs re-transfer the part of data where transfer the error hasoccurred, upon data transfer between a host device and a target device.

Further, the embodiment provides a data transfer method which performsproper data transfer even if bus reset occurs in data transfer between ahost device and a target device.

Further, a peripheral device such as a printer which utilizes the abovedata transfer methods can be provided.

[Modification of Embodiment]

Note that the above embodiment has been described in a case where anetwork is constructed by using the IEEE 1394 serial bus, however, thepresent invention is not limited to the 1394 serial bus. For example,the present invention is applicable to a network constructed by using anarbitrary serial interface such as a Universal Serial Bus (USB).

In the above-described embodiment, commands and responses to thecommands based on the FCP protocol are employed, and information is setat the response and notified to the host device. However, a method ofmapping a register on a memory as the characteristic feature of the IEEE1394 memory bus model can be considered.

In this case, a command is executed by writing command data into acommand register assigned to a specific address of the memory.Similarly, a response is indicated by reading data at a responseregister assigned to a specific address of the memory.

Accordingly, when the target device recognizes that a command haswritten into a command register, the target device executes the command,and writes the result of the execution of the command and informationinto a response register. The host device which has written the commandinto the command register reads the response register of the targetdevice and obtains the result of the execution of the command andinformation.

Thus, the present invention can be realized by using registers in thememory bus model.

In the above-described embodiment, discussing examples which have atarget device as a printer. However, the target device of the presentinvention is not limited to the printer. That is, some device recordingimage data such as a display apparatus and a storage apparatus appliesto the target device of the present invention.

The present invention can be applied to a system constituted by aplurality of devices (e.g., host computer, interface, reader, printer)or to an apparatus comprising a single device (e.g., copy machine,facsimile).

Further, the object of the present invention can be also achieved byproviding a storage medium storing program codes for performing theaforesaid processes to a system or an apparatus, reading the programcodes with a computer (e.g., CPU, MPU) of the system or apparatus fromthe storage medium, then executing the program.

In this case, the program codes read from the storage medium realize thefunctions according to the embodiments, and the storage medium storingthe program codes constitutes the invention.

Further, the storage medium, such as a floppy disk, a hard disk, anoptical disk, a magneto-optical disk, CD-ROM, CD-R, a magnetic tape, anon-volatile type memory card, and ROM can be used for providing theprogram codes.

Furthermore, besides aforesaid functions according to the aboveembodiments are realized by executing the program codes which are readby a computer, the present invention includes a case where an OS(operating system) or the like working on the computer performs a partor entire processes in accordance with designations of the program codesand realizes functions according to the above embodiments.

Furthermore, the present invention also includes a case where, after theprogram codes read from the storage medium are written in a functionexpansion card which is inserted into the computer or in a memoryprovided in a function expansion unit which is connected to thecomputer, CPU or the like contained in the function expansion card orunit performs a part or entire process in accordance with designationsof the program codes and realizes functions of the above embodiments.

The present invention is not limited to the above embodiments andvarious changes and modifications can be made within the spirit andscope of the present invention. Therefore, to appraise the public of thescope of the present invention, the following claims are made.

1. A data transmission method used between a data supply device and atarget device, said method comprising the steps of: locking the targetdevice such that the target device does not receive communicationcontrol from another device; transmitting capability information of thetarget device to the data supply device from the target device after thetarget device is locked; and transmitting data to the locked targetdevice from the data supply device based on the capability information.2. The method according to claim 1, wherein the capability informationincludes buffer information which indicates a buffer size of receivingdata of the target device or the number of available buffers of thetarget device.
 3. The method according to claim 2, wherein the datasupply device transmits the data in a unit of the data amount indicatedby the buffer information, and the target device receives the datatransferred in the unit.
 4. The method according to claim 1, wherein thedata supply device and the target device are connected by a bus adaptedto or based on IEEE 1394 standards or Universal Serial Bus standards. 5.A data supply apparatus for transmitting data to a target device, saidapparatus comprising: a locker, arranged to lock the target device suchthat the target device does not receive communication control fromanother device; a receiver, arranged to receive capability informationof the target device from the target device after the target device islocked; and a transmitter, arranged to transmit data to the lockedtarget device based on the received capability information.
 6. Theapparatus according to claim 5, wherein the capability informationincludes buffer information which indicates a buffer size of receivingdata of the target device or the number of available buffers of thetarget device.
 7. The apparatus according to claim 6, wherein saidtransmitter transmits the data in a unit of the data amount indicated bythe buffer information.
 8. The apparatus according to claim 5, whereinthe apparatus and the target device are connected by a bus adapted to orbased on IEEE 1394 standards or Universal Serial Bus standards.
 9. Amethod of controlling a data supply device which transmits data to atarget device, said method comprising the steps of: locking the targetdevice such that the target device does not receive communicationcontrol from another device; receiving capability information of thetarget device from the target device after the target device is locked;and transmitting data to the locked target device based on the receivedcapability information.
 10. The method according to claim 9, wherein thecapability information includes buffer information which indicates abuffer size of receiving data of the target device or the number ofavailable buffers of the target device.
 11. The method according toclaim 10, wherein the transmitting step transmits the data in a unit ofthe data amount indicated by the buffer information.
 12. The methodaccording to claim 9, wherein the data supply device and the targetdevice are connected by a bus adapted to or based on IEEE 1394 standardsor Universal Serial Bus standards.